package com.akk.module.app.service;


import com.akk.module.app.entity.AppUserGrade;
import com.akk.module.app.entity.AppUserGradeExample;
import com.akk.module.app.mapper.AppUserGradeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AppUserGradeService {
    @Autowired
    AppUserGradeMapper appUserGradeMapper;
    @Autowired
    AppUserGradeExample appUserGradeExample;

    public AppUserGrade findByUserGradeId(String userGradeId) {
        AppUserGrade appUserGrade = appUserGradeMapper.selectByPrimaryKey(userGradeId);
        return appUserGrade == null?new AppUserGrade():appUserGrade;
    }

    public List<AppUserGrade> findByAppId(String appId) {
        appUserGradeExample.clear();
        appUserGradeExample.createCriteria().andAppIdEqualTo(appId);
        return appUserGradeMapper.selectByExample(appUserGradeExample);
    }
}
